package com.partvoyage.client.mvp2.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.partvoyage.shared.InfoPointBean;

public class LoadDataDetailPointEvent extends
		GwtEvent<LoadDataDetailPointEvent.LoadDataDetailPointEventHandler> {
	public static Type<LoadDataDetailPointEventHandler> TYPE = new Type<LoadDataDetailPointEventHandler>();

	public enum TYPE_DETAIL_POINT {
		TYPE_ALL, TYPE_NETTOYAGE, TYPE_REALOAD_OU
	}

	public interface LoadDataDetailPointEventHandler extends EventHandler {
		void onLoadDataDetailPoint(LoadDataDetailPointEvent event);
	}

	private TYPE_DETAIL_POINT typeInformation;
	private InfoPointBean infoPointBean;

	public LoadDataDetailPointEvent(InfoPointBean infoPointBean,
			TYPE_DETAIL_POINT typeInformation) {
		this.typeInformation = typeInformation;
		this.infoPointBean = infoPointBean;
	}

	public LoadDataDetailPointEvent(TYPE_DETAIL_POINT typeInformation) {
		this.typeInformation = typeInformation;
		this.infoPointBean = null;
	}

	public TYPE_DETAIL_POINT getTypeInformation() {
		return typeInformation;
	}

	public InfoPointBean getInfoPointBean() {
		return infoPointBean;
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<LoadDataDetailPointEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(LoadDataDetailPointEventHandler handler) {
		handler.onLoadDataDetailPoint(this);

	}
}
